<template>
	<view>
		<!--轮播-->
		<view style="width: 100%; margin-bottom: 15px; border-radius: 5px; overflow: hidden">
			<u-swiper :list="banner" keyName="image" indicator indicatorMode="dot" imgMode="aspectFill" circular
				:height="120">
			</u-swiper>
		</view>
		<!--教材选择-->
		<view style="margin: 5px; padding: 10px; border-radius: 5px;position: relative; background-color: #f1f1f1;">
			<view style="position: absolute; right:15px;">
				<u-button icon="reload" size="mini" type="primary" @click="handleBookSwitch">切换教材</u-button>
			</view>
			<view style="display: flex;">
				<image :src="book.cover" style="width: 76px;height: 100px;"></image>
				<view style="margin-left: 10px; padding-top: 20px;">
					<view style="font-weight: bold;">{{book.subject}}</view>
					<view style="margin-top:20px; font-size: 12px;">
						{{book.grade}} · {{book.ceshu}} · {{book.version}}
					</view>
				</view>
			</view>
		</view>

		<view>
			<view>学习工具</view>
			<view>学习工具</view>
			<view>学习工具</view>
			<view>学习工具</view>
			<view>学习工具</view>
			<view>学习工具</view>
			<view>学习工具</view>
			<view>学习工具</view>
			<view>学习工具</view>
			<view>学习工具</view>
			<image :src="book.cover" style="width: 76px;height: 100px;"></image>
			<image :src="book.cover" style="width: 76px;height: 100px;"></image>
			<image :src="book.cover" style="width: 76px;height: 100px;"></image>
			<image :src="book.cover" style="width: 76px;height: 100px;"></image>
			<image :src="book.cover" style="width: 76px;height: 100px;"></image>
			<image :src="book.cover" style="width: 76px;height: 100px;"></image>

		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				curtab: 1,
				book: {
					bookid: "c1a",
					subject: "语文",
					grade: "一年级",
					ceshu: "上册",
					version: "统编版",
					checked: false,
					cover: 'http://rc.metahike.com/bookcovers/tbb_c1a.jpg'
				},
				banner: [{
						image: 'http://rc.metahike.com/banner/swiper1.png',
						link: ''
					},
					{
						image: 'http://rc.metahike.com/banner/swiper2.png',
						link: ''
					}
				]
			}
		},
		onLoad() {
			if (uni.getStorageSync("curbook")) {
				this.book = uni.getStorageSync("curbook");
			}
		},
		methods: {
			HnadletabbarClick(index) {
				this.$router.push("/pages/book_switch");
				console.log(index);
			},
			handleBookSwitch() {
				uni.navigateTo({
					url: "/pages/book_switch"
				})
			}
		}
	}
</script>

<style>

</style>